home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_xmllib.py < prev    next >
Encoding:
Text File  |  2000-06-23  |  523 b   |  26 lines

  1. '''Test module to thest the xmllib module.
  2.    Sjoerd Mullender
  3. '''
  4.  
  5. from test_support import verbose
  6.  
  7. testdoc = """\
  8. <?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
  9. <!-- comments aren't allowed before the <?xml?> tag,
  10.      but they are allowed before the <!DOCTYPE> tag -->
  11. <!DOCTYPE greeting [
  12.   <!ELEMENT greeting (#PCDATA)>
  13. ]>
  14. <greeting>Hello, world!</greeting>
  15. """
  16.  
  17. import xmllib
  18. if verbose:
  19.     parser = xmllib.TestXMLParser()
  20. else:
  21.     parser = xmllib.XMLParser()
  22.  
  23. for c in testdoc:
  24.     parser.feed(c)
  25. parser.close()
  26.